
Write-Host 
# define variables for script

$SiteUrl = "http://win-scjail07sml:81/"
$masterpageurl = "/_catalogs/masterpage/multi.master"

# check to ensure Microsoft.SharePoint.PowerShell is loaded
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null) {
	Write-Host "Loading SharePoint Powershell Snapin"
	Add-PSSnapin "Microsoft.SharePoint.Powershell"
}

Get-SPSite -Identity $SiteUrl | Get-SPWeb | ForEach-Object { 
	
	Write-Host "Updating Web :"  -foregroundcolor Magenta
	Write-Host "- Title =    " $_.Title -foregroundcolor Magenta
	
	$_.MasterUrl = $masterpageurl
	$_.Update()
}
